import request from '@/utils/request'

// 订单详情
export function info(orderId) {
  return request({
    url: `/admin/api/order/info/${orderId}`,
    method: 'get'
  })
}

export function listOrderItem(params) {
  return request({
    url: '/admin/api/order/orderItemList',
    method: 'get',
    params
  })
}

export function orderStatistics(params) {
  return request({
    url: '/admin/api/order/orderStatistics',
    method: 'get',
    params
  })
}

// 订单详情
export function orderInfoByOrderSn(params) {
  return request({
    url: `/admin/api/order/info`,
    method: 'get',
    params
  })
}

// 删除订单
export function deleteOrder(ids) {
  return request({
    url: `/admin/api/order/delete`,
    method: 'delete',
    data: ids
  })
}

// 修改
export function editOrder(data) {
  return request({
    url: `/admin/api/order/edit`,
    method: 'put',
    data: data
  })
}
export function outWare(orderSn) {
  return request({
    url: `/admin/api/order/outWare/`+orderSn,
    method: 'get'
  })
}
export function closeOrder(orderSn) {
  return request({
    url: `/admin/api/order/cancelOrder/`+orderSn,
    method: 'get'
  })
}
export function isReturn(params) {
  return request({
    url: `/admin/api/order/isReturn`,
    method: 'get',
    params
  })
}
export function outOrderList(params) {
  return request({
    url: `/admin/api/order/outOrderList`,
    method: 'get',
    params,
    responseType: 'blob'
  })
}
export function cancelWare(orderSn) {
  return request({
    url: `/admin/api/order/cancelWare/` + orderSn,
    method: 'put'
  })
}
